package srv

import (
	"go.uber.org/zap"
	"time"
	"venus/service/sv_cmd"
	"venus/util/zlog"
	"venus/util/ztime"
)

func CmdRegister() {
	sv_cmd.Bind("test", test)
}

func test(args []string) {

	defer ztime.ExecNanosecond(time.Now(), "cmd test")

	zlog.Debug("cmd test ", zap.Any("args", args))

	if len(args) > 0 {
		arg1 := args[0]
		if arg1 == "1" {
			zlog.Debug("test 1")
			//list := make([]*pub_objects.User, 0)
			//list = append(list, &pub_objects.User{Uuid: 1})
			//list = append(list, &pub_objects.User{Uuid: 2})
			//value := &pub_objects.User{Uuid: 1}
			//testany := zslice.AnyBy(list, value, func(v1 *pub_objects.User, v2 *pub_objects.User) bool {
			//	return v1.Uuid == v2.Uuid
			//})
			//zlog.Debug("1", zap.Any("testany", testany))
			//testall := zslice.AllBy(list, value, func(v1 *pub_objects.User, v2 *pub_objects.User) bool {
			//	return v1.Uuid == v2.Uuid
			//})
			//zlog.Debug("1", zap.Any("testall", testall))
		}

	}
}
